package nix.demo3.service;

import nix.demo3.dao.CustomerDao;
import nix.demo3.domain.Customer;
import nix.demo3.domain.PageBean;

public class CustomerService {

	private CustomerDao customerDao = new CustomerDao();

	/**
	 * 添加客户
	 */
	public void add(Customer customer) {
		customerDao.add(customer);
	}

	/**
	 * 查询所有
	 */
	public PageBean<Customer> findAll(int pc, int ps) {
		return customerDao.findAll(pc, ps);
	}

	/**
	 * 通过cid加载客户
	 */
	public Customer load(String cid) {
		return customerDao.load(cid);
	}

	/**
	 * 修改客户
	 */
	public void edit(Customer customer) {
		customerDao.edit(customer);
	}

	/**
	 * 删除客户
	 */
	public void delete(String cid) {
		customerDao.delete(cid);
	}

	/**
	 * 条件查询
	 */
	public PageBean<Customer> query(Customer criteria, int pc, int ps) {
		return customerDao.query(criteria, pc, ps);
	}
}
